package com.firemoss.consumermediatorexample.events
{
	import flash.events.Event;
	
	import mx.events.DynamicEvent;
	
	public class EventFactory
	{
		
		public static function create( type : String, data : Object = null ) : Event
		{
			var event : DynamicEvent = new DynamicEvent( type, true )
			
			if ( data )
			{
				for ( var key : String in data )
				{
					event[ key ] = data[ key ]	
				}
			}
			
			return event
		}

	}
}